package com.troy.entity;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName(value = "t_user")//映射数据库的表名
public class User implements Serializable {
    //type = IdType.AUTO 数据库字段一定要是自增
    //type = IdType.INPUT手动输入
    @TableId(value = "id",type = IdType.INPUT)
    private String id;

    @TableField(value = "username")
    private String username;

    private Integer age;

    @JsonFormat(pattern = "yyyy年MM月dd日",timezone = "GMT+8")
    private Date birthday;

    @Version
    private Integer version;

    @TableField(exist = false)//不映射数据库表的字段
    private String gggg;

}
